package com.mpgame.handler;

import com.mpgame.common.handler.BaseHandler;
import com.mpgame.common.proto.*;

import io.netty.channel.ChannelHandlerContext;

public class ChatHandler extends BaseHandler{
    @Override
    public boolean handle(ChannelHandlerContext ctx, GamePacket pkt) {
        try{
            ChatRsp rsp = ChatRsp.parseFrom(pkt.getData());

            System.out.println(rsp.getSenderName() + ": " + rsp.getContent());

            return true;
        }catch(Exception e){
            return false;
        }
    }
}
